﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using University.Workshop.Model;

namespace University.Workshop.DataAccess
{
    public static class LogOnDataAccess
    {
        static MedicalCenterEntities entities = MedicalCenterEntities.Instance;
        public static bool SignIn(LogOn logOn)
        {
            if (logOn != null)
            {
                    var userLogged = from user in entities.Users
                                     where user.LogOn == logOn.UserName && user.Password==logOn.Password
                                     select user;
                    if (userLogged.Count() == 0)
                        return false;

                //DataTable data = DatabaseManager.Instance.ExecuteQuery(string.Format("select LogOn, Password from [User] where LogOn='{0}' and Password='{1}'", logOn.UserName, logOn.Password));
            }
            return true;
        }
    }
}
